themingengine: Don't draw 0px borders
authorBenjamin Otte <otte@redhat.com>
Tue, 14 Jan 2014 02:22:15 +0000 (03:22 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 14 Jan 2014 02:38:04 +0000 (03:38 +0100)
Theming code gets confused when computing the spacing for 0px wide dots
and then divides by 0. And then cairo complains and stops drawing
anything forever out of spite and then we end up with a single color
screen.

https://bugzilla.gnome.org/show_bug.cgi?id=721800

gtk/gtkthemingengine.c

index b38059bab0928644ce8a80b8c57f668d0a3e3231..136fcc657f90ba44724c8ef2c69257d2e3c85391 100644 (file)
@@ -1591,6 +1591,13 @@ render_border (cairo_t       *cr,
       if (hidden_side & (1 << i))
         continue;
 
+      /* NB: code below divides by this value */
+      /* a border smaller than this will not noticably modify
+       * pixels on screen, and since we don't compare with 0,
+       * we'll use this value */
+      if (border_width[i] < 1.0 / 1024)
+        continue;
+
       switch (border_style[i])
         {
         case GTK_BORDER_STYLE_NONE: